import { defineStore } from 'pinia'

export const useContextStore = defineStore('context', {
    state: () => {
        return {
            showFilters: false,
            showSidenav: true, // TODO: store and load from localStorage
            loadingSetup: false,
            serverReady: false,

            // UI > GENERAL
            showCardLabels: true,
            experimental: false,

            // UI > SCENES
            sceneAspectRatio: 16 / 9,
            scenePauseOnUnfocus: false,
            scenePreviewOnMouseHover: false,
            sceneSeekBackward: 5,
            sceneSeekForward: 5,

            // UI > ACTORS
            actorAspectRatio: 3 / 4,
            fillActorCards: true,
            actorSingular: "Actor",
            actorPlural: "Actors",

            // UI > MOVIES
            defaultDVDShow3d: true,
        }
    },
    getters: {
        //
    },
    actions: {
        //
        setCurrentValueByKesy(key: string, value: any) {
            // @ts-ignore
            this.current[key] = value
        },
        setValueByKesy(key: string, value: any) {
            // @ts-ignore
            this[key] = value
        },
    },
})
